package hy;

import sun.misc.BASE64Encoder;

import java.security.MessageDigest;

public class Demo1 {
    public static void main(String[] args)throws Exception {
        String pass="admin";
        MessageDigest md=MessageDigest.getInstance("MD5");
        byte[] arr = md.digest(pass.getBytes());
        BASE64Encoder ec=new BASE64Encoder();

        System.out.println(new String(arr));
        System.out.println(ec.encode(arr));
    }
}
